#pragma once

#include "Polygon.h"
#include <vector>

class ScanLine
{
	struct Edge {
		int x0, y0, x1, y1;
		Edge();
		Edge(int x0, int y0, int x1, int y1);
		bool operator < (const Edge &u) const;
	};
	struct ActiveEdge {
		int ymax, x, dx, dy, c;
		ActiveEdge();
		ActiveEdge(int ymax, int x, int dx, int dy);
		bool operator < (const ActiveEdge &u) const;
		void xinc();
	};
	std::vector<Edge> et;
	std::vector<ActiveEdge> aet;

	int start, end;
public:
	ScanLine(Polygon &polygon);
	void draw();
};

